<!doctype html>
<script src="../../resources/js-test.js"></script>
<form id="f1">
    <button id=n1></button>
    <fieldset id=n1><legend id=legend1></legend></fieldset>
    <input name=n1 type=hidden>
    <input name=n1 type=image>
    <input name=n1 type=text>
    <input name=n1 type=radio>
    <output id=n1></output>
    <object name=n1></object>
    <select name=n1><option id=n1></option></select>
    <textarea id=n1></textarea>
    <div id=n1></div>
    <option id=n1></option>
</form>
<script>
description("Test RadioNodeLists returned by the HTMLFormElement named-getter.");

var form1 = document.getElementById("f1");
shouldBe("form1.elements.length", "9");

debug("Check that only 'listed elements' are included in the list, if any.");
var radioNodeList = form1["n1"];
shouldBe("radioNodeList.length", "9");

shouldBeTrue("radioNodeList[0] instanceof HTMLButtonElement");
shouldBeTrue("radioNodeList[1] instanceof HTMLFieldSetElement");
shouldBeTrue("radioNodeList[2] instanceof HTMLInputElement");
shouldBeEqualToString("radioNodeList[2].type", "hidden");
shouldBeTrue("radioNodeList[3] instanceof HTMLInputElement");
shouldBeEqualToString("radioNodeList[3].type", "text");
shouldBeTrue("radioNodeList[4] instanceof HTMLInputElement");
shouldBeEqualToString("radioNodeList[4].type", "radio");
shouldBeTrue("radioNodeList[5] instanceof HTMLOutputElement");
shouldBeTrue("radioNodeList[6] instanceof HTMLObjectElement");
shouldBeTrue("radioNodeList[7] instanceof HTMLSelectElement");
shouldBeTrue("radioNodeList[8] instanceof HTMLTextAreaElement");
</script>

